home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsICookieService.idl < prev    next >
Text File  |  2006-05-08  |  7KB  |  170 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  26.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. #include "nsISupports.idl"
  39.  
  40. interface nsIURI;
  41. interface nsIPrompt;
  42. interface nsIChannel;
  43.  
  44. /**
  45.  * nsICookieService
  46.  *
  47.  * Provides methods for setting and getting cookies in the context of a
  48.  * page load.  See nsICookieManager for methods to manipulate the cookie
  49.  * database directly.  This separation of interface is mainly historical.
  50.  *
  51.  * This service broadcasts the following notifications when the cookie
  52.  * list is changed, or a cookie is rejected:
  53.  *
  54.  * topic  : "cookie-changed"
  55.  *          broadcast whenever the cookie list changes in some way. there
  56.  *          are four possible data strings for this notification; one
  57.  *          notification will be broadcast for each change, and will involve
  58.  *          a single cookie.
  59.  * subject: an nsICookie2 interface pointer representing the cookie object
  60.  *          that changed.
  61.  * data   : "deleted"
  62.  *          a cookie was deleted. the subject is the deleted cookie.
  63.  *          "added"
  64.  *          a cookie was added. the subject is the added cookie.
  65.  *          "changed"
  66.  *          a cookie was changed. the subject is the new cookie.
  67.  *          "cleared"
  68.  *          the entire cookie list was cleared. the subject is null.
  69.  *
  70.  * topic  : "cookie-rejected"
  71.  *          broadcast whenever a cookie was rejected from being set as a
  72.  *          result of user prefs.
  73.  * subject: an nsIURI interface pointer representing the URI that attempted
  74.  *          to set the cookie.
  75.  * data   : none.
  76.  */
  77. [scriptable, uuid(011C3190-1434-11d6-A618-0010A401EB10)]
  78. interface nsICookieService : nsISupports
  79. {
  80.   /*
  81.    * Get the complete cookie string associated with the URI.
  82.    *
  83.    * @param aURI
  84.    *        the URI of the document for which cookies are being queried.
  85.    * @param aChannel
  86.    *        the channel used to load the document.  this parameter may be null,
  87.    *        but it is strongly recommended that a non-null value be provided to
  88.    *        ensure that the cookie privacy preferences are honored.
  89.    *
  90.    * @return the resulting cookie string
  91.    */
  92.   string getCookieString(in nsIURI aURI, in nsIChannel aChannel);
  93.  
  94.   /*
  95.    * Get the complete cookie string associated with the URI.
  96.    *
  97.    * XXX this function is redundant and will most likely be removed in a future
  98.    * revision of this interface.  GetCookieString will query the documentURI
  99.    * property off of nsIHttpChannelInternal if supported, so GetCookieString
  100.    * can be used in place of this method.
  101.    *
  102.    * @param aURI
  103.    *        the URI of the document for which cookies are being queried.
  104.    * @param aFirstURI
  105.    *        the URI that the user originally typed in or clicked on to initiate
  106.    *        the load of the document referenced by aURI.
  107.    * @param aChannel
  108.    *        the channel used to load the document.  this parameter may be null,
  109.    *        but it is strongly recommended that a non-null value be provided to
  110.    *        ensure that the cookie privacy preferences are honored.
  111.    *
  112.    * @return the resulting cookie string
  113.    */
  114.   string getCookieStringFromHttp(in nsIURI aURI, in nsIURI aFirstURI, in nsIChannel aChannel);
  115.  
  116.   /*
  117.    * Set the cookie string associated with the URI.
  118.    *
  119.    * @param aURI
  120.    *        the URI of the document for which cookies are being set.
  121.    * @param aPrompt
  122.    *        the prompt to use for all user-level cookie notifications.
  123.    * @param aCookie
  124.    *        the cookie string to set.
  125.    * @param aChannel
  126.    *        the channel used to load the document.  this parameter may be null,
  127.    *        but it is strongly recommended that a non-null value be provided to
  128.    *        ensure that the cookie privacy preferences are honored.
  129.    *
  130.    * XXX should be able to allow null aPrompt, since nsIPrompt can be queryied
  131.    * from aChannel.
  132.    */
  133.   void setCookieString(in nsIURI aURI, in nsIPrompt aPrompt, in string aCookie, in nsIChannel aChannel);
  134.  
  135.   /*
  136.    * Set the cookie string and expires associated with the URI.
  137.    *
  138.    * XXX this function is redundant and will most likely be removed in a future
  139.    * revision of this interface.  SetCookieString will query the documentURI
  140.    * property off of nsIHttpChannelInternal if supported, and SetCookieString
  141.    * could also query the Date header from the channel if aChannel supports
  142.    * nsIHttpChannel.
  143.    *
  144.    * @param aURI
  145.    *        the URI of the document for which cookies are being set.
  146.    * @param aFirstURI
  147.    *        the URI that the user originally typed in or clicked on to initiate
  148.    *        the load of the document referenced by aURI.
  149.    * @param aPrompt
  150.    *        the prompt to use for all user-level cookie notifications.
  151.    * @param aCookie
  152.    *        the cookie string to set.
  153.    * @param aServerTime
  154.    *        the expiry information of the cookie (the Date header from the HTTP
  155.    *        response).
  156.    * @param aChannel
  157.    *        the channel used to load the document.  this parameter may be null,
  158.    *        but it is strongly recommended that a non-null value be provided to
  159.    *        ensure that the cookie privacy preferences are honored.
  160.    */
  161.   void setCookieStringFromHttp(in nsIURI aURI, in nsIURI aFirstURI, in nsIPrompt aPrompt, in string aCookie, in string aServerTime, in nsIChannel aChannel);
  162.  
  163.   /**
  164.    * This attribute really doesn't belong on this interface.  CVS blame will
  165.    * tell you why it is here.  It remains until we can find a better home for
  166.    * it.  Read the source if you want to know what it does :-(
  167.    */
  168.   readonly attribute boolean cookieIconIsVisible;
  169. };
  170.